<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>网页标题</title>
	</head>
	<body>
		
		<script>
			
			
			window.onload = function()
			{
				console.log("页面加载完成")
				
				//通过document可以访问网页内容
				console.log(document.title)
				//document.title = "O(∩_∩)O哈哈~"
				
				var i = 0;
				//setInterval(定时要执行的代码，时间的间隔)
				setInterval(function()
				{
					if(i==0)
					{
						document.title = "O(∩_∩)O哈哈~"
						i=1
					}
					else
					{
						document.title = "O(∩_∩)O嘿嘿~"
						i=0
					}
					
					// var r = Math.floor(Math.random()*256);
					// var g = Math.floor(Math.random()*256);
					// var b = Math.floor(Math.random()*256);
					// //rgb(255,0,0)
					// document.body.style.backgroundColor = "rgb("+r+","+g+","+b+")"
					
				},1000)
				
				
				
				
			}
			
			
			
			
			
			
		</script>
	</body>
</html>